package com.eapi.project.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eapi.project.mapper.InvokerecordMapper;
import com.eapi.project.model.entity.Invokerecord;
import com.eapi.project.model.vo.statistics.DateInvokeVO;
import com.eapi.project.service.InvokerecordService;
import com.eapi.project.model.vo.statistics.UserInvokeCount;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author lenovo
* @description 针对表【invokerecord(点赞记录表)】的数据库操作Service实现
* @createDate 2024-04-24 18:54:06
*/
@Service
public class InvokerecordServiceImpl extends ServiceImpl<InvokerecordMapper, Invokerecord>
    implements InvokerecordService {

    @Resource
    private InvokerecordMapper invokerecordMapper;
    @Override
    public List<DateInvokeVO> dateStatistics() {
        return invokerecordMapper.dateStatistics();
    }

    @Override
    public Long getTotalCost(Long userId) {
        return invokerecordMapper.getTotalCost(userId);
    }

   /* invokerecord.setInterfaceInfoId(interfaceInfoId);
    invokerecord.setUserId(userId);
    invokerecord.setInvokeCosts(invokeCosts);
    invokerecord.setInterfaceInfoName(interfaceInfo.getName());
    invokerecord.setDescription(interfaceInfo.getDescription());*/
    @Override
    public boolean insertInvoke(Invokerecord invokerecord) {
        return invokerecordMapper.insertInvoke(invokerecord);
    }

    @Override
    public List<UserInvokeCount> getMostLikeInterface(Long userId) {
        return invokerecordMapper.getMostLikeInterface(userId);
    }
}




